#!/bin/bash

DIRECTORY=$1
LOGFILE="/tmp/large_files.log"

if [ ! -d "$DIRECTORY" ]; then
  echo "The specified directory does not exist."
  exit 1
fi

find "$DIRECTORY" -type f -size +1M -exec ls -lh {} \; | awk '{ print $9 ": " $5 }' > "$LOGFILE"

echo "Log file has been created at $LOGFILE."
